package org.jivesoftware.smackx.muc;

import java.util.LinkedList;
import org.jivesoftware.smack.packet.Packet;

class ConnectionDetachedPacketCollector
{
  private static final int MAX_PACKETS = 65536;
  private LinkedList<Packet> resultQueue = new LinkedList();

  /**
   * @deprecated
   */
  public Packet nextResult()
  {
    monitorenter;
    try
    {
      if (!(this.resultQueue.isEmpty()))
      {
        label2: Packet localPacket = (Packet)this.resultQueue.removeLast();
        return localPacket;
      }
    }
    finally
    {
      try
      {
        super.wait();
      }
      catch (InterruptedException localInterruptedException)
      {
        break label2:
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  /**
   * @deprecated
   */
  public Packet nextResult(long paramLong)
  {
    monitorenter;
    try
    {
      boolean bool1;
      label21: if (bool1);
    }
    finally
    {
      try
      {
        super.wait(paramLong);
        boolean bool2 = this.resultQueue.isEmpty();
        if (bool2)
        {
          localPacket = null;
          monitorexit;
          return localPacket;
        }
        Packet localPacket = (Packet)this.resultQueue.removeLast();
      }
      catch (InterruptedException localInterruptedException)
      {
        break label21:
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  /**
   * @deprecated
   */
  public Packet pollResult()
  {
    Packet localPacket;
    monitorenter;
    try
    {
      boolean bool = this.resultQueue.isEmpty();
      if (bool)
      {
        localPacket = null;
        monitorexit;
        return localPacket;
      }
    }
    finally
    {
      monitorexit;
    }
  }

  /**
   * @deprecated
   */
  // ERROR //
  protected void processPacket(Packet paramPacket)
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_1
    //   3: ifnonnull +6 -> 9
    //   6: aload_0
    //   7: monitorexit
    //   8: return
    //   9: aload_0
    //   10: getfield 19	org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector:resultQueue	Ljava/util/LinkedList;
    //   13: invokevirtual 47	java/util/LinkedList:size	()I
    //   16: ldc 7
    //   18: if_icmpne +11 -> 29
    //   21: aload_0
    //   22: getfield 19	org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector:resultQueue	Ljava/util/LinkedList;
    //   25: invokevirtual 31	java/util/LinkedList:removeLast	()Ljava/lang/Object;
    //   28: pop
    //   29: aload_0
    //   30: getfield 19	org/jivesoftware/smackx/muc/ConnectionDetachedPacketCollector:resultQueue	Ljava/util/LinkedList;
    //   33: aload_1
    //   34: invokevirtual 51	java/util/LinkedList:addFirst	(Ljava/lang/Object;)V
    //   37: aload_0
    //   38: invokevirtual 54	java/lang/Object:notifyAll	()V
    //   41: goto -35 -> 6
    //   44: astore_2
    //   45: aload_0
    //   46: monitorexit
    //   47: aload_2
    //   48: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   9	41	44	finally
  }
}